<template>
    <div class="home">
        home页面
        <div class="rembox"></div>
    </div>
</template>

<script>
import { getSwiperData } from "@/api";
export default {
    name: "HomeView",
    data() {
        return {
            swiper: null
        };
    },
    // 创建期
    created() {
        this.getSwiper();
    },
    // async await
    methods: {
        // getSwiper() {
        //     const params = { token: "1ec949a15fb709370f" };
        //     getSwiperData(params).then((res) => {
        //         console.log(res);
        //         this.swiper = res.data;

        //     });

        // }
        async getSwiper() {
            const params = { token: "1ec949a15fb709370f" };
            const result = await getSwiperData(params);

            this.swiper = result.data.data;
        }
    }
};
</script>
<style lang="less">
.rembox {
    border: 1px solid red;
    height: 200px;
    width: 375px;
}
</style>
